package DomainLayer;

public class Request
{
    private Supplier supplier;
    private int amount;
    
    /**
     * @param supplier a person or a company which sells goods to this company.
     * @param amount a number of product ordered.
     */
    public Request(Supplier supplier, int amount)
    {
        this.supplier = supplier;
        this.amount = amount;
    }
    
    //@return string an information about the order/request for the supplier.
    public String printRequestInfo(){
        String s = null;
        s = "##### REQUEST INFORMATION #####"+'\n'+
            "Supplier: "+getSupplier().getName()+'\n'+getSupplier().getProduct()+'\n'+
            "Amount of product ordered: "+getAmount()+'\n'+
            "Amount of total price: "+getTotalPrice()+'\n';
        return s;
    }
    
    public void setSupplier(Supplier supplier){
        this.supplier = supplier;
    }
    
    public void setAmount(int amount){
         this.amount = amount;
    }
    
    public double getTotalPrice(){
        return getAmount()*getSupplier().getProduct().getPrice();
    }
    
    public Supplier getSupplier(){
        return supplier;
    }
    
    public int getAmount(){
        return amount;
    }
}
